package compilador.analisadorLexico;
/**
 *
 * @author Henrique
 */
public class Token {
	
    private TokenClass classe;
    private Object atributo;
    private int linha;
        
    protected Token(){
    }
        
    public Token(TokenClass token) {
            this.classe = token;
    }

    public Token(TokenClass classe, Object atributo, int linha) {
        this.classe = classe;
        this.atributo = atributo;
        this.linha = linha;
    }
	
    public TokenClass getTokenClass() {
            return classe;
    }

    public void setAtributo(Object atributo) {
        this.atributo = atributo;
    }
        
    public Object getAtributo() {
            return atributo;
    }

    public int getLinha() {
        return linha;
    }

    public void setLinha(int linha) {
        this.linha = linha;
    }

        
    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("[TokenClass: " + this.getTokenClass());

        //if(this.getToken().permiteAtributo())
        builder.append(" Atributo: '" + this.getAtributo() + "'");
        builder.append(" Linha: " + this.getLinha() + "]");

        return builder.toString();
    }
}
